package cn.huiyunche.driver.datasync.schedule;

import cn.huiyunche.driver.service.UpdateWaybillService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class UpDateOrderSchedule implements Job, Serializable {

    private static final Logger LOGGER = LoggerFactory.getLogger(ImportOrderSchedule.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        LOGGER.info("UpDateOrderSchedule.execute start : {}", df.format(new Date()));
        UpdateWaybillService updateWaybillService = QuartzClusterFactory.updateWaybillService();
        updateWaybillService.updateWaybillType();
        LOGGER.info("ImportOrderSchedule.execute end time : {}", df.format(new Date()));
    }
}
